/**
 * 网站基本设置
 * @returns
 */
layui.use(['jquery','layer','table','form'],function(){
	 var $ = layui.$,
     layer = layui.layer,
     form = layui.form,
     table = layui.table;
	
	
	
	$(document).ready(function(){
		
		
		$.post("/systemsetup/basicsetup/websitesettings/getWebSiteSettings",{},function(result){
			if(result.status == 200){
				$("#id").val(result.data["id"]);
				$("#title").val(result.data["title"]);
				$("#weburl").val(result.data["weburl"]);
				$("#seotitle").val(result.data["seotitle"]);
				$("#seoKeyword").val(result.data["seoKeyword"]);
				$("#seoDescribe").val(result.data["seoDescribe"]);
				$("#logo").val(result.data["logo"]);
				$("#recordNumber").val(result.data["recordNumber"]);
				$("#copyright").val(result.data["copyright"]);
				$("#companyAddress").val(result.data["companyAddress"]);
				$("#contactNumber").val(result.data["contactNumber"]);
				$("#mailbox").val(result.data["mailbox"]);	
			}
		});
	
		
		
		
		
	});

	
	  //监听提交
    form.on('submit(WebSiteSettings)', function(data){
    	$.post("/systemsetup/basicsetup/websitesettings/updateWebSiteSettings",data.field,function(result){
    		if (result.status == 200) {
    			layer.msg(result.msg);
    			
    			layer.msg(result.msg, {
					icon: 1,
					time: 2000 //2秒关闭（如果不配置，默认是3秒）
				}, function(){
					window.location.reload();
				});
    			
			} else {
				layer.msg(result.msg);
			}
    	});
    	
    	return false;
    });

});